﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using Magalie.Domaine;

namespace Magalie.Views
{
    public partial class Organisations : Page
    {
        public Organisations()
        {
            InitializeComponent();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {

        }

        private void OpenOrganisation_Click(object sender, RoutedEventArgs e)
        {
            Organisation orga = ((Button) sender).DataContext as Organisation;
            EditOrganisation edit = new EditOrganisation();
            edit.Show(orga, organisationsDataSource);
        }

        private void OpenProjet_Click(object sender, RoutedEventArgs e)
        {
            Magalie.Domaine.Projet prj = ((Button)sender).DataContext as Magalie.Domaine.Projet;

            NavigationService.Navigate(new Uri("/Projet/" + prj.MappingUri, UriKind.Relative));
        }

    }
}
